#include "normaltab.h"
#include "ui_normaltab.h"


normalTab::normalTab(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::normalTab)
{

    ui->setupUi(this);
    this->font = QFont("Consolas",16);
    ui->textEdit->setFont(font);
    QFontMetrics metrics(ui->textEdit->font());
    int tabWidth = metrics.horizontalAdvance(' ') * 4;  // 4 个空格的宽度
    ui->textEdit->setTabStopDistance(tabWidth);
    getTextEdit()->setLineWrapMode(QTextEdit::NoWrap); // 禁用自动换行
    this->isEdit = true;
    this->filePath="";
}

normalTab::~normalTab()
{
    delete ui;
}
QTextEdit* normalTab::getTextEdit(){
    return this->ui->textEdit;
}
void normalTab::setIsEdit(bool isEdit){
     this->isEdit = isEdit;
}
bool normalTab::getIsEdit(){
     return this->isEdit;
}
QString normalTab::getFilePath(){
    return this->filePath;
}

void normalTab::setFilePath(QString filePath){
    this->filePath = filePath;
}
